QuickTime 3 Reference

Previous | Chapter Top | Chapter Contents | Next

The Decompression Parameters Structure

Several fields have been added to the decompression parameters structure ( CodecDecompressParams ) originally documented in Chapter 4 of Inside Macintosh: QuickTime Components . In addition, there are several new flags in the codecConditions field. The first two fields listed below ( frameTime , reserved ) replace the last field ( reserved ) documented in Chapter 4 of Inside Macintosh: QuickTime Components .

struct CodecDecompressParams
{
...
/* The following fields are defined in QuickTime 2.0 or later */
    ICMFrameTimePtr     frameTime;      /* banddecompress */
    long                reserved[1];
    SInt8               matrixFlags;
    SInt8               matrixType;
    Rect                dstRect;    /*  only valid for                                          simple transforms */

/* The following fields are defined in QuickTime 2.1 or later */
    UInt16              majorSourceChangeSeed;
    UInt16              minorSourceChangeSeed;
    CDSequenceDataSourcePtr     sourceData;
    
    RgnHandle       maskRegion;

/* The following fields are defined in QuickTime 2.5 or later */
    OSType              **wantedDestinationPixelTypes;/* Handle to
                                        0-terminated list of OSTypes */

    long                screenFloodMethod;
    long                screenFloodValue;
    short               preferredOffscreenPixelSize;

/* The following fields are defined in QuickTime 3 or later */
    boolean             enableBlackLining;
    long                requestedBufferWidth;
    long                requestedBufferHeight;
;

Field descriptions

frameTime
Contains a pointer to an ICMFrameTime structure The Frame Time Structure . This structure contains a frame's time information for scheduled asynchronous decompression operations.
matrixFlags
Flags specifying information about the transformation matrix. Currently, can be 0 or one of the following:
enum {     matrixFlagScale2x = 1L<<7,     matrixFlagScale1x = 1L<<6,     matrixFlagScaleHalf = 1L<<5 };
matrixType
Contains the type of the transformation matrix, as returned by GetMatrixType(). (For additional information refer to Inside Macintosh: QuickTime, p. 2-342).
dstRect
The destination rectangle. The result of the source rectangle ( srcRect ) transformed by the transformation matrix ( matrix ).
majorSourceChangeSeed
Contains an integer value that is incremented each time a data source is added or removed. This provides a fast way for a codec to know when it needs to redetermine which data source inputs are available.
minorSourceChangeSeed
Contains an integer value that is incremented each time a data source is added or removed, or the data contained in any of the data sources changes. This provides a way for a codec to know if the data available to it has changed.
sourceData
Contains a pointer to a CDSequenceDataSource structure The Decompression Data Source Structure . This structure contains a linked list of all data sources. Because each data source contains a link to the next data source, a codec can access all data sources from this field.
maskRegion
If the maskRegion field is not nil , it contains a QuickDraw region that is equivalent to the bit map contained in the maskBits field. For some codecs, using the QuickDraw region may be more convenient than the mask bit map.
wantedDestinationPixelTypes
Filled in by the codec during ImageCodecPreDecompress . Contains a handle to a zero-terminated list of non-RGB pixels that the codec can decompress to. Leave set to nil if the codec does not support non-RGB pixel spaces. The ICM copies this data structure, so it is up to the codec to dispose of it later. Since the predecompress call can be called often, it is suggested that codecs allocate this handle during the Open routine and dispose of it during the Close routine.
screenFloodMethod
For codecs that require key-color flooding. One of:
enum {     kScreenFloodMethodNone = 0,     kScreenFloodMethodKeyColor = 1,     kScreenFloodMethodAlpha = 2 };
screenFloodValue
If screenFloodMethod is kScreenFloodMethodKeyColor , contains the index of the color that should be used to flood the image area on screen when a refresh occurs. This is valid for both indexed and direct screen devices (e.g., for devices with 16-bit depth, it should contain the 5-5-5 RGB value). If screenFloodMethod is kScreenFloodMethodAlpha , contains the value that the alpha-channel should be flooded with.
preferredOffscreenPixelSize
Should be filled in ImageCodecPreDecompress with the preferred depth of an offscreen buffer should the ICM have to create one. It is not guaranteed that an offscreen buffer will actually be of this depth. A codec should still be sure to specify what depths it can decompress to by using the capabilities field. A codec might use this field if if was capable of decompressing to several depths, but was faster decompressing to a particular depth.
enableBlackLining
If true, indicates that the client has requested blacklining (displaying every other line of the image). Blacklining increases the speed of movie playback while decreasing the image quality.
requestedBufferWidth
Specifies the the width of the image buffer to use, in pixels. For this value to be used, the codecWantsSpecialScaling flag in the CodecCapabilities record must be set.
requestedBufferHeight
Specifies the the height of the image buffer to use, in pixels. For this value to be used, the codecWantsSpecialScaling flag in the CodecCapabilities record must be set.

codecConditions flags

Several new flags exist that can be set in the codecConditions parameter. They are:

enum {
    codecConditionFirstScreen       = 1L << 12,
    codecConditionDoCursor          = 1L << 13,
    codecConditionCatchUpDiff       = 1L << 14,
    codecConditionMaskMayBeChanged  = 1L << 15,
    codecConditionToBuffer          = 1L << 16
};
codecConditionFirstScreen
Indicates when the codec is decompressing an image to the first of multiple screens. That is, if the decompressed image crosses multiple screens, then the codec can look at this flag to determine if this is the first time an image is being decompressed for each of the screens to which it is being decompressed.
A codec that depends on the maskBits field of decompressParams being a valid regionHandle on CDPreDecompress needs to know that in this case it is not able to clip images since the region handle is only passed for the first of the screens; clipping would be incorrect for the subsequent screen for that image.
codecConditionDoCursor
Set to 1 if the decompressor component should shield and unshield the cursor for the current decompression operation. This flag should be set only if the codec has indicated its ability to handle cursor shielding by setting the codecCanShieldCursor flag in the capabilities field during CDPreDecompress .
codecConditionCatchUpDiff
Indicates if the current frame is a "catch up" frame. Set this flag to 1 if the current frame is a catch-up frame. Note that you must also set the codecFlagCatchUpDiff flag to 1. This may be useful to decompressors that can drop frames when playback is falling behind.
codecConditionMaskMayBeChanged
The Image Compression Manager has always included support for decompressors that could provide a bit mask of pixels that were actually drawn when a particular frame was decompressed. If a decompressor can provide a bit mask of pixels that changed, the Image Compression Manager transfers to the screen only the pixels that actually changed.
QuickTime 2.1 extended this capability by adding a new condition flag ( codecConditionMaskMayBeChanged ) to the conditionFlags field of the decompression parameters structure. The decompressor should write back the mask only if this flag is set. This flag is used only by the function ImageCodecBandDecompress .
codecConditionToBuffer
Set to 1 if the current decompression operation is decompressing into an offscreen buffer.

© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next